﻿<html>
<style>
.overLoading {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #f5f5f5;
            opacity:0.5;
            z-index: 1000;
       }
.layoutLoading {
    display: none;
    position: absolute;
    top: 40%;
    left: 40%;
    width: 20%;
    height: 20%;
    z-index: 1001;
    text-align:center;
    }
</style>
<script language="javascript">
var logdate,logname,logmode,logkind;
    function query1(){
        logdate =document.form.logdate.value; 
        logname = document.form.logname.value;
        logmode = document.form.logmode.value;
        logkind =document.form.logkind.value;
        url = "/mon?logdate="+logdate+"&logname="+logname+"&logmode="+logmode+"&logkind="+logkind;
        window.location.href = url;
    }
   
    function ShowImage(id){
        var ywlx= document.getElementById('ywlx').value;
        var jylx= document.getElementById('jylx').value;
              if(ywlx=="9990000302"){
                 if (id=="1"){
                
                    document.getElementById('sncx').value="0";
                }else{
                    document.getElementById('sncx').value="1";
                    alert(document.getElementById('sncx').value);
                }
                 alert(document.getElementById('sncx').value);
                 
              }
        }

</script>
<script type="text/javascript">
function add(key,value)
{
    document.getElementById(key).value = value;
    document.getElementById("form").submit();
    //document.argform.submit();
    //document.getElementById("argsubmit").click();
}
</script>
<SCRIPT language=javascript type=text/javascript src="/static/jquery-1.7.2.min.js"></SCRIPT>
<script type="text/javascript">
  var arr_city = [
                    [["qy","签约"],["zf","支付"],["tk","退款"],["cx","查询"],["jy","解约"],["yqy","预签约"]],
                    [["bdss","保单试算"],["xbcb","新保承保"],["bdbd","保单补打"],["drcd","当日撤单"],["lscx","流水查询"],["yqy","预签约"]],
                    [["qy","签约"],["zf","支付"],["tk","退款"],["cx","查询"],["jy","解约"],["yqy","预签约"]],
                    [["qy","签约"],["zf","支付"],["tk","退款"],["cx","查询"],["jy","解约"],["yqy","预签约"]],
                    [["qy","签约"],["zf","支付"],["tk","退款"],["cx","查询"],["jy","解约"],["yqy","预签约"]],
                    [["bdss","保单试算"],["xbcb","新保承保"],["bdbd","保单补打"],["drcd","当日撤单"],["lscx","流水查询"],["yqy","预签约"]],
                    [["ybt_zz","银保通转账"],["gmt_qk","柜面通取款"],["gmt_ck","柜面通存款"],["ybt_pzzxhcx","银保通凭证最小号查询"],["drcd","当日撤单"],["lscx","流水查询"],["yqy","预签约"]],
                    [["qy","签约"],["xyzf","协议支付"],["tk","退款"],["cx","查询"],["jy","解约"],["yqy","预签约"]],
                    [["qy","签约"],["zf","支付"],["tk","退款"],["cx","查询"],["jy","解约"],["yqy","预签约"]],
                ];
  function setDetailMsgRow(sel) {
    var city = document.form.jylx;
    var index = sel.selectedIndex;
    city.length = arr_city[index].length;
    for (var j = 0; j<arr_city[index].length;j++) {
        city.options[j].text = arr_city[index][j][1];
        city.options[j].value = arr_city[index][j][0];
        if (arr_city[index][j][0]=='{{jylx}}'){
//            alert(arr_city[index][j][0]);
//            alert('{{jylx}}');
            city.options[j].selected = true;
        }
    }
    var ywlx = sel.value;
    // 初始隐藏所有字段 每个业务根据需要设置必须显示内容
    var rowID_None=['cxzt_td','cxzt_vl','sncx_td','sncx_vl','jyje_td','jyje_vl','qyxyh_td','qyxyh_vl','yjyrq_td','yjyrq_vl','yzflsh_td','yzflsh_vl',
        'hxdk_td','hxdk_vl','hxdz_td','hxdz_vl','tbdysh_td','tbdysh_vl','bxdysh_td','bxdysh_vl'];
    for (var i=0;i<rowID_None.length;i++){ 
        var row = document.getElementById(rowID_None[i]); 
          if (row != null) { 
            row.style.display = "none";
//                row.style.visibility= "hidden "; 
        } 
    }    
    
    if (ywlx == 'P010031001'){
        var rowID=['jyje_td','jyje_vl','qyxyh_td','qyxyh_vl','jy_log_td','jy_log_vl'];
        for (var i=0;i<rowID.length;i++){ 
            
            var row = document.getElementById(rowID[i]); 
              if (row != null) { 
                row.style.display = "";
//                row.style.visibility= "visible "; 
            } 
        } 
    }
    else if(ywlx == '9990000215'){
//// 不必要的字段进行隐藏或者显示
        var rowID=['jyje_td','jyje_vl','jy_log_td','jy_log_vl'];
        for (var i=0;i<rowID.length;i++){ 
            var row = document.getElementById(rowID[i]); 
              if (row != null) { 
                row.style.display = "";
//                row.style.visibility= "visible "; 
            } 
        }
    }
    else if(ywlx == '9990000210'){
//// 不必要的字段进行隐藏或者显示
        var rowID=['jyje_td','jyje_vl','jy_log_td','jy_log_vl','tbdysh_td','tbdysh_vl','bxdysh_td','bxdysh_vl'];
        for (var i=0;i<rowID.length;i++){ 
            
            var row = document.getElementById(rowID[i]); 
              if (row != null) { 
                row.style.display = "";
//                row.style.visibility= "visible "; 
            } 
        }
    }
    else if(ywlx == 'hxbw'){
//// 不必要的字段进行隐藏或者显示
        var rowID=['jyje_td','jyje_vl','yjyrq_td','yjyrq_vl','hxdk_td','hxdk_vl','hxdz_td','hxdz_vl'];// 显示table列表
        for (var i=0;i<rowID.length;i++){ 
            
            var row = document.getElementById(rowID[i]); 
              if (row != null) { 
                row.style.display = "";
//                row.style.visibility= "visible "; 
            } 
        }
    }
    else{
        var rowID=['jyje_td','jyje_vl','qyxyh_td','qyxyh_vl','jy_log_td','jy_log_vl'];
        for (var i=0;i<rowID.length;i++){ 
            
            var row = document.getElementById(rowID[i]); 
              if (row != null) { 
                row.style.display = "";
//                row.style.visibility= "visible "; 
            } 
        }
    }
  } 
  /*自动加载隐藏框,ready方法必须要引用jquery的库*/
  $(document).ready(function(){ 
    var arr_province = [["9990000301","支付宝快捷支付"],["9990000210","中国人寿"],["9990000303","京东快捷支付"],["9990000302","苏宁快捷支付"],["9990000307","腾讯快捷支付"],
    ["9990000215","平安人寿"],["hxbw","核心交易"],["P010031001","网联"]];
    var province = document.form.ywlx;
    //指定省份中<option>标记的个数
    province.length = arr_province.length;

    //循环将数组中的数据写入<option>标记中
    for(var i=0;i<arr_province.length;i++){
        province.options[i].text = arr_province[i][1];
        province.options[i].value = arr_province[i][0];
        if (arr_province[i][0]=='{{ywlx}}'){
//            alert(arr_city[index][j][0]);
//            alert('{{jylx}}');
            province.options[i].selected = true;
        }
    }


    var sel = document.getElementById('ywlx');
    setDetailMsgRow(sel);
  });
  function onload() {
    var sel = document.getElementById('ywlx');
    setDetailMsgRow(sel); 
  } 
  
function showLoading(show){

    if(show){
       document.getElementById("over").style.display = "block";
       document.getElementById("layout").style.display = "block";
    }else{
       document.getElementById("over").style.display = "none";
       document.getElementById("layout").style.display = "none";
    }
    document.getElementById("form").submit();
}
</script>


<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>自动化测试</title>
</head>

<body style="text-align: center">

<form method="post" name="form" id="form" action="oatest_sub_kjzf_ty">
	<p>自动化测试(发送环境:<select size="1" name="sendhost" id="fshost" tabindex="2">
        {%for row in hj_list%}
			<option value="{{row.get('ip')}}"   {{ 'selected' if sendhost == row.get('ip') else '' }}>{{row.get('hostname')}}</option>
        {%endfor%}
			</select><a href = "javascript:;" onclick ="add('data_sel','1');">测试数据选择</a><input type="hidden" name="data_sel" id="data_sel" value="0"/>)</p>                                                        
	<table border="1"  align="center" id="table1">
		<tr id="tr_1">
			<td width="82" align="right"><font size="2">业务类型</font></td>
			<td><select size="1" name="ywlx" id="ywlx" tabindex="2" onchange = "setDetailMsgRow(this)">
			</select></td>
			<td width="82" align="right"><font size="2">交易代码</font></td>
			<td><select size="1" name="jylx" id="jylx" tabindex="8">
			</select></td>
		</tr>
		<tr id="tr_2">
			<td width="82" align="right" id="cxzt_td"><font size="2">查询状态</font></td>
			<td id="cxzt_vl"><select size="0" name="cxzt" id="cxzt" tabindex="2" onchange="ShowImage(document.getElementById('cxzt').value);">
			<option value="1"  {{ 'selected' if cxzt == "1" else '' }}>单笔支付查询</option>
			<option value="2"  {{ 'selected' if cxzt == "2" else '' }}>单笔退款查询</option>
	
			</select></td>
			<td width="82" align="right"  id="sncx_td" ><font size="2"></font></td>
			<td  id="sncx_vl"><input type="text" id="sncx" name="sncx"></td>
		</tr>
		<tr id="tr_3">
			<td width="82" align="right"><font size="2">卡号</font></td>
			<td>
            <select name="yhzhlx" id="yhzhlx" >
			<option value="D" {{ 'selected' if yhzhlx == "D" else '' }}>借记卡</option>
			<option value="C" {{ 'selected' if yhzhlx == "C" else '' }}>信用卡</option>
			</select>
            <input type="text" name="yhkh" id="textarea" cols="45" rows="1"value="{{yhkh or ''}}"></input>
			<td width="82" align="right"><font size="2">证件号码</font></td>
			<td>
            <select name="zjlx" id="zjlx" >
			<option value="01" {{ 'selected' if zjlx == "01" else '' }}>身份证</option>
			<option value="02" {{ 'selected' if zjlx == "02" else '' }}>军官证</option>
			</select>
            <input type="text" name="zjhm" id="textarea" cols="45" rows="1" value="{{zjhm or ''}}"></input>
		</tr>
		<tr id="tr_4">
			<td width="82" align="right"><font size="2">客户名称</font></td>
			<td>
            <input name="khmc" id="textarea" cols="45" rows="1" value="{{khmc.decode('gbk') if khmc else ''}}"></input>
			<td width="82" align="right"><font size="2">手机号码</font></td>
			<td>
            <input name="sjhm" id="textarea" cols="45" rows="1" value="{{sjhm or ''}}"></input>
		</tr>
		<tr id="tr_5">
			<td width="82" align="right" id="yzflsh_td"><font size="2">原支付流水号</font></td>
			<td id="yzflsh_vl">
            <input name="yzflsh" id="textarea" cols="45" rows="1" value="{{yzflsh or ''}}" placeholder="退款冲正等交易必填"></input>
			<td width="82" align="right" id="yjyrq_td"><font size="2">原交易日期</font></td>
			<td id="yjyrq_vl">  
            <input name="yjyrq" id="textarea" cols="45" rows="1" value="{{yjyrq or ''}}" placeholder="退款冲正等交易必填"></input>
		</tr>
		<tr id="tr_6">
			<td width="82" align="right" id="jyje_td" ><font size="2">交易金额</font></td>
			<td id="jyje_vl" >
            <input name="jyje" id="textarea" cols="45" rows="1" value="{{jyje or ''}}" placeholder="账务类或者退款类交易必填"></input>
			<td width="82" align="right" id="qyxyh_td" ><font size="2">签约协议号</font></td>
			<td id="qyxyh_vl" >
            <input name="qyxyh" id="textarea" cols="45" rows="1" value="{{qyxyh or ''}}"></input>
		</tr>
		<tr id="tr_7">
			<td width="82" align="right" id="hxdz_td" ><font size="2">核心地址</font></td>
			<td id="hxdz_vl" >
            <input name="hxdz" id="textarea" cols="45" rows="1" value="{{hxdz or '10.3.142.230'}}" placeholder="地址 如esb.hf"></input>
			<td width="82" align="right" id="hxdk_td" ><font size="2">核心端口</font></td>
			<td id="hxdk_vl" >
            <input name="hxdk" id="textarea" cols="45" rows="1" value="{{hxdk or '10013'}}" placeholder="端口 如8888"></input>
		</tr>
		<tr id="tr_8">
			<td width="82" align="right" id="tbdysh_td" ><font size="2">投保单印刷号</font></td>
			<td id="tbdysh_vl" >
            <input name="tbdysh" id="textarea" cols="45" rows="1" value="{{tbdysh or '1172201808101509'}}" placeholder="如1172201808101509"></input>
			<td width="82" align="right" id="bxdysh_td" ><font size="2">保险单印刷号</font></td>
			<td id="bxdysh_vl" >
            <input name="bxdysh" id="textarea" cols="45" rows="1" value="{{bxdysh or '10013'}}" placeholder="如8888"></input>
		</tr>
	</table>
    <p><p><p>
    <table border="1"  align="center" id="table2">
        <tr>
			<td width="82" align="right"  id="jy_log_td" ><font size="2">交易日志</font></td>
			<td id="jy_log_vl">
            <a href="{{jy_log or ''}}" target="_blank">显示日志</a>
            </td>
		</tr>
        <tr>
			<td width="82" align="right"><font size="2">响应报文</font></td>
			<td>
            <textarea id="textarea" cols="100" rows="13">{{response or ''}}</textarea>
		</tr>
	</table>
    <div id="over" class="overLoading">
    </div>
    <div id="layout" class="layoutLoading"><img src="/static/images/loading.gif" /><p>后台正在玩命处理…………</div>

	<p>
    <!--button type="submit" class="submit_button">提交</button-->
    <input  onClick="showLoading(true)" type="button"  value="提交" name="B1">&nbsp;
	<input type="reset" value="重置" name="B2"></p>

	<p style="text-align: middle">版权所有(C) 2012-2017 平欣电子科技有限公司
	<a href="http://www.levelappro.com/">www.levelappro.com&nbsp;</a></p>
            <!--form action="" method="post" id="main_form">
                <input type="text" name="username" class="username" placeholder="请输入您的用户名！" />
                <input type="password" name="password" class="password" placeholder="请输入您的用户密码！" />
                <input type="Captcha" class="Captcha" name="Captcha" placeholder="请输入验证码！" />
				<a href="#" id="get_code_img"><img src="get_code" class="getcode" /></a>
                <button type="submit" class="submit_button">登录</button>
                <div class="error"><span>+</span></div>
            </form-->
		
</form>
</body>

</html>
